const app = getApp();
const Controller = require('../controllers/controllers.js').controller;
const WxParse = require('../Common/wxParse/wxParse.js');
Page({
  data: {
    key:'',
    title:'',
    quesitem:'',
    content:'',
  },
  onLoad: function (option) {
    this.setData({
      quesitem:app.globalData.quesitem
    })
    console.log(app.globalData.quesitem)
    wx.setNavigationBarTitle({
      title:this.data.quesitem.title
    })
    this.appinfo()
    
  },
  onShow(){

  },
  appinfo(){
      if(this.data.quesitem){
        this.data.quesitem.answer = JSON.stringify(this.data.quesitem.answer).replace(/<img/gi, "<img class='richImg' style='width:auto!important;height:auto!important;max-height:100%;width:100%;'");
        this.data.quesitem.answer = JSON.parse(this.data.quesitem.answer);
        var content=this.data.quesitem.answer
        var that = this;
        WxParse.wxParse('content', 'html', content, that, 5);
      }
  },
  onShareAppMessage: function( options ){
     
  },
})